package org.acme;

import java.util.ArrayList;
import java.util.Collection;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.OneToMany;


@Entity
public class Customer extends JPAEntity {
	private String name;
	@OneToMany(cascade=CascadeType.ALL) 
	private Collection<Movie> movies = new ArrayList<Movie>();

	
	public Customer() {}
	public Customer(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}
	
	public Collection<Movie> getMovies() {
		return movies;
	}
	
	public void addMovie(Movie movie) {
		movies.add(movie);
	}
}
